function message(player)
	print("Character name: "..player:getName()..". HP = "..player:getHealth())
end

player = Character.new("Hero", 100)
player:setHealth(80)

message(player)


weapon = Weapon.new()
weapon:attack(player)

message(player)


fdm = FlightDynamicModel.new()
fdm:longitude(110.0)
fdm:latitude(20.0)
fdm:altitude(10000)
fdm:time(0.0)


print(fdm:longitude(), fdm:latitude(), fdm:altitude(), fdm:time())

flightPath = FlightPath.new()
flightPath:push_back(fdm)
flightPath:push_back(fdm)
flightPath:push_back(fdm)
flightPath:push_back(fdm)
flightPath:push_back(fdm)

fdm2 = flightPath:at(0)
fdm2:longitude(120.0)

print(fdm2:longitude(), fdm2:latitude(), fdm2:altitude(), fdm2:time())
print(flightPath:size())

for i=0,flightPath:size()-1 do
	print(flightPath:at(i):longitude())
end

function createFlightPath()
	local fp = FlightPath.new()
	local fdm = FlightDynamicModel.new()

	fdm:longitude(110.0)
	fdm:latitude(20.0)
	fdm:altitude(10000)
	fdm:time(0.0)

	fp:push_back(fdm)
	fp:push_back(fdm)
	fp:push_back(fdm)
	fp:push_back(fdm)

	return fp
end

registry = debug.getregistry()

function dumpTable(name, t, nestCount)
	nestCount = nestCount or 0;

	local indent = "";
	for i=0,nestCount-1 do
		indent = indent..'\t'
	end

	print(indent..name.."->")

	for k, v in pairs(t) do
		print(indent, k, ":", v)
	end

	print()

	for k, v in pairs(t) do
		if type(v) == "table" then
			dumpTable(k, v, nestCount+1)
			local mt = debug.getmetatable(v)
			if mt then
				dumpTable("metatable", mt, nestCount+2)
			end
		elseif type(v) == "userdata" then
			local mt = debug.getmetatable(v)
			if mt then
				dumpTable('['..tostring(v).."].metatable", mt, nestCount+1)
			end
		end
	end

end

dumpTable("LuaWrapper", registry.LuaWrapper)
collectgarbage()
print("\nAfter collectgarbage()\n")
dumpTable("LuaWrapper", registry.LuaWrapper)

--[[
print("registry.LuaWrapper >>>>>")
for k,v in pairs(registry.LuaWrapper) do
	print(k, v)
end

print("\n")
print("registry.LuaWrapper.holds >>>>>")
for k,v in pairs(registry.LuaWrapper.holds) do
	print(k, v)
end

print("\n")
print("registry.LuaWrapper.cache >>>>>")
for k,v in pairs(registry.LuaWrapper.cache) do
	print(k, v)
end

print("\n")
print("registry.LuaWrapper.cachemetatable >>>>>")
for k,v in pairs(registry.LuaWrapper.cachemetatable) do
	print(k, v)
end

print("\n")
print("registry.LuaWrapper.storage >>>>>")
for k,v in pairs(registry.LuaWrapper.storage) do
	print(k, v)
end
--]]